'''
文件操作
'''
import os

# 获取当前目录
current_directory = os.getcwd() 
print("current_directory:{}".format(current_directory))

# 
op_file_path = current_directory + '\\test.c'
print("op_file_path:{}".format(op_file_path))

file1 = open(op_file_path,"r+",encoding='utf-8')

# read 函数里边不加参数 默认从文件开头 读取文件的所有内容
# 加了参数，如果是file_content = file1.read(100)，则表示从开头处开始读取100byte的内容
file_content = file1.read(20)

print(file_content)

file1.close()


